import {Customer} from "@/interface";

export {type Customer}

export interface Column {
       title: string;
       width?: number | string;
       dataKey?: keyof Order;
       forbidEdit?: boolean;
       params?: any;
       tdAlign?: "right" | "left" | "center" | "justify" | "char";
       slotName?: string;
       callback?:(value:any)=>any;
       headerSlotName?: string;
}

export interface Factory<T = Order> {
       factory_id: number;
       freight?:number,   //运费
       tax?:number,       //税点费
       eCash?:number,     //电子现金抵扣券
       factoryName: string;
       factoryCustomer: Array<Customer>;
       factoryCoupon: Array<FactoryCoupon>;
       order: FactoryOrder<T>;
}


export interface FactoryOrder<T = Order> {
       diy?: Array<T>;
       fabric?: Array<T>;
       spot?: Array<T>;
}

// export interface Customer {
//        customer_id: number;
//        customer_name: string;
//        customer_phone: string;
//        qrcode?: string;
// }

export interface FactoryCoupon {
       coupon_id: number;
       coupon_discount: number;
       coupon_name: string;
}

export interface Order {
       order_no: string;
       goods_name: string;
       img: string;
       purchase?: number;
       spec: string;
       price: number;
       total: number;
}

export interface OrderShow extends Order {
       checked?: boolean;
       deleteLoading?: boolean;
}

export interface CartChecked extends CartReduce {
       lastPrice:number;  //最后的价格
       discount: number;  //优惠的价格
}

export interface CartReduce {
       goods_num: number; //所选的商品数量
       totalPrice: number; //所选的商品总价钱
}

export interface CartEcashChecked extends CartChecked{ 
       eCash:number  ;  //剩余电子现金使用卷
}







